package com.bear.fastrepair.http.api.employee

import com.bear.fastrepair.entity.*
import retrofit2.http.*

interface OrderByEmployee {
    /**
     * 员工到场打卡
     * @param locationAddress String
     * @param locationLatitude String
     * @param locationLongitude String
     * @param serviceOrderId String
     */
    @PUT("mobile/serviceOrder/checkIn/{serviceOrderId}")
    suspend fun employeeClockIn(
        @Path("serviceOrderId") serviceOrderId: String?,
        @Body clockInBody: ClockInBody
    ): ResponseInfo

    /**
     * 机器带回
     * @param serviceOrderId String
     * @param images String
     * @param remark String
     * @return ResponseInfo
     */
    @PUT("mobile/serviceOrder/orderBringBack/{serviceOrderId}")
    suspend fun takeMachineBack(
        @Path("serviceOrderId") serviceOrderId: String,
        @Body orderCommonBody: OrderCommonBody
    ): ResponseInfo

    /**
     * 带回维修完成
     * @param serviceOrderId String
     * @param images String
     * @param remark String
     */
    @PUT("mobile/serviceOrder/orderBringBackFinish/{serviceOrderId}")
    suspend fun takeBackFixDone(
        @Path("serviceOrderId") serviceOrderId: String,
        @Body orderCommonBody: OrderCommonBody
    ): ResponseInfo

    /**
     * 员工完成订单
     * @param serviceOrderId String
     * @param images String
     * @param remark String
     */
    @PUT("mobile/serviceOrder/orderFinish/{serviceOrderId}")
    suspend fun orderComplete(
        @Path("serviceOrderId") serviceOrderId: String,
        @Body orderCommonBody: OrderCommonBody
    ): ResponseInfo

    /**
     * 订单退回
     * @param serviceOrderId String
     * @param images String
     * @param remark String
     */
    @PUT("mobile/serviceOrder/orderReturn/{serviceOrderId}")
    suspend fun orderSendBack(
        @Path("serviceOrderId") serviceOrderId: String,
        @Body orderCommonBody: OrderCommonBody
    ): ResponseInfo

    /**
     * 分页查询服务订单
     * @param current Int
     * @param size Int
     * @param orderStatus Int?
     * @return EmployeeOrderInfoPage
     */
    @GET("mobile/serviceOrder/page")
    suspend fun getOrderInfoPageByEmployee(
        @Query("current") current: Int,
        @Query("size") size: Int,
        @Query("orderStatus") orderStatus: Int? = null
    ): EmployeeOrderInfoPage

    /**
     * 根据ID查询服务订单
     * @param id String
     * @return OrderInfoDetail
     */
    @GET("mobile/serviceOrder/{id}")
    suspend fun getOrderInfoById(@Path("id") id: String): OrderInfoDetail

    /**
     * 保存预约时间
     * @param serviceOrderId String
     * @param bookingBody BookingBody
     * @return ResponseInfo
     */
    @PUT("mobile/serviceOrder/saveAppointTime/{serviceOrderId}")
    suspend fun saveBookingTime(@Path("serviceOrderId") serviceOrderId: String, @Body bookingBody: BookingBody): ResponseInfo
}